Skip to content

feat(astro): Add OAuth flow components - #3719

Merged
panteliselef merged 8 commits into
mainfrom
rob/eco-42-add-support-for-authenticatewithredirectcallback
Jul 16, 2024
Merged

feat(astro): Add OAuth flow components#3719
panteliselef merged 8 commits into
mainfrom
rob/eco-42-add-support-for-authenticatewithredirectcallback

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Jul 15, 2024

Copy link
Copy Markdown
Member

Description

This PR tackles ECO-42 and introduces the <AuthenticateWithRedirectCallback /> component for both Astro and React. A new function was added to invoke Clerk methods when Clerk is loaded (similar to what we do with UI components).

E2E tests are to follow based on our convo in #team-ecosystem. For now, here's a working demo and repo for some confidence.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

chore(astro): Make sure Clerk is loaded before invoking functions
@changeset-bot

changeset-bot Bot commented Jul 15, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a35c4ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wobsoriano wobsoriano changed the title feat(astro): Add OAuth flow component for Astro and React feat(astro): Add OAuth flow components Jul 15, 2024
Comment on lines +10 to +21
// TODO: Move this to a prop when we implement more control components.
const functionName = 'handleRedirectCallback';
---

<div data-clerk-function-id={`clerk-${functionName}-${safeId}`}></div>

<script is:inline define:vars={{ props: Astro.props, functionName, safeId }}>
/**
* Store the id and the props for the Astro component in order to invoice the correct Clerk function once clerk is loaded.
* The above is handled by `invokeClerkAstroJSFunctions`.
*
* TODO: This should be moved to a separate file once we implement more control components.

@wobsoriano wobsoriano Jul 15, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some TODOs here so that in the future when we want to implement more control components that call invoke Clerk functions, we can extract and reuse it

@wobsoriano
wobsoriano marked this pull request as ready for review July 15, 2024 19:24
@wobsoriano
wobsoriano requested a review from panteliselef July 15, 2024 20:12
Comment thread .changeset/short-otters-return.md Outdated
wobsoriano and others added 2 commits July 15, 2024 14:37
Co-authored-by: panteliselef <panteliselef@outlook.com>

@panteliselef panteliselef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, can you make the demo repo public ?

@panteliselef
panteliselef enabled auto-merge (squash) July 16, 2024 08:53
@panteliselef
panteliselef merged commit c92104e into main Jul 16, 2024
@panteliselef
panteliselef deleted the rob/eco-42-add-support-for-authenticatewithredirectcallback branch July 16, 2024 12:02
@wobsoriano

Copy link
Copy Markdown
Member Author

Nice work, can you make the demo repo public ?

Oh 🤦🏼 updated to public!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants